<!DOCTYPE html>
<html lang="">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <link rel="shortcut icon" href="#" />
    <script src="https://cesium.com/downloads/cesiumjs/releases/1.103/Build/Cesium/Cesium.js"></script>
    <link
      href="https://cesium.com/downloads/cesiumjs/releases/1.103/Build/Cesium/Widgets/widgets.css"
      rel="stylesheet"
    />
    <title>火炬区生态环境大数据综合平台</title>
  </head>
  <body>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>
<style>
  * {
    margin: 0;
    padding: 0;
  }
</style>
<script>
  // 动态计算并设置根元素的字体大小
  function setRootFontSize() {
    var html = document.getElementsByTagName("html")[0];
    var screenWidth = window.innerWidth || document.documentElement.clientWidth;
    var designWidth = 1920;
    var defaultFontSize = 16;
    var fontSize = (screenWidth / designWidth) * defaultFontSize;
    console.log(screenWidth, fontSize);
    html.style.fontSize = fontSize + "px";
  }
  // 页面加载完成后设置根元素的字体大小
  window.addEventListener("load", setRootFontSize);
  // 窗口大小变化时重新设置根元素的字体大小
  window.addEventListener("resize", setRootFontSize);
</script>
